function enableWebp() {
    let enableWebp = document.createElement('canvas').toDataURL('image/webp').indexOf('data:image/webp') ===
        0;
    return enableWebp
}
export function getSrc(src: any, quality: number, suffix: any) {

    // 阿里只支持如下格式图片的处理
    const supportFormats = /(jpe?g|png|bmp|tiff)$/;
    if (supportFormats.test(src)) {
        const _quality = typeof quality === 'number' ? `/quality,q_${quality}` : '';
        const _format = enableWebp() ? '/format,webp' : '';
        const _suffix = typeof suffix === 'string' ? suffix : '';
        const params = `${_quality}${_format}${_suffix}`;
        src += params ? `?x-oss-process=image${params}` : '';
    }
    return src;
};
